﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.ComponentModel;

namespace JQuery
{
    public class ModalPopupExtender : JQueryExtender
    {
        [JQueryElement("autoOpen")]
        public bool? AutoOpen
        {
            get { return GetPropertyValue<bool>("AutoOpen", null); }
            set { SetPropertyValue("AutoOpen", value); }
        }

        [JQueryElement("bgiframe")]
        public bool? BackgroundIframe
        {
            get { return GetPropertyValue<bool>("BackgroundIframe", null); }
            set { SetPropertyValue("BackgroundIframe", value); }
        }

        [JQueryElement("closeOnEscape")]
        public bool? CloseOnEscape
        {
            get { return GetPropertyValue<bool>("CloseOnEscape", null); }
            set { SetPropertyValue("CloseOnEscape", value); }
        }

        [JQueryElement("dialogClass")]
        public string DialogClass
        {
            get { return GetPropertyValue<string>("DialogClass", null); }
            set { SetPropertyValue("DialogClass", value); }
        }

        [JQueryElement("draggable")]
        public bool? Draggable
        {
            get { return GetPropertyValue<bool>("Draggable", null); }
            set { SetPropertyValue("Draggable", value); }
        }

        [JQueryElement("height")]
        public int? Height
        {
            get { return GetPropertyValue<int>("Height", null); }
            set { SetPropertyValue("Height", value); }
        }

        [JQueryElement("hide")]
        public string HideEffect
        {
            get { return GetPropertyValue<string>("HideEffect", null); }
            set { SetPropertyValue("HideEffect", value); }
        }

        [JQueryElement("maxHeight")]
        public int? MaxHeight
        {
            get { return GetPropertyValue<int>("MaxHeight", null); }
            set { SetPropertyValue("MaxHeight", value); }
        }

        [JQueryElement("maxWidth")]
        public int? MaxWidth
        {
            get { return GetPropertyValue<int>("MaxWidth", null); }
            set { SetPropertyValue("MaxWidth", value); }
        }

        [JQueryElement("minHeight")]
        public int? MinHeight
        {
            get { return GetPropertyValue<int>("MinHeight", null); }
            set { SetPropertyValue("MinHeight", value); }
        }

        [JQueryElement("Modal")]
        public bool? Modal
        {
            get { return GetPropertyValue<bool>("Modal", null); }
            set { SetPropertyValue("Modal", value); }
        }

        [JQueryElement(null, "position", false, @"('((center)|(top)|(bottom)|(left)|(right))')|(\['((center)|(top)|(bottom)|(left)|(right))',\ ?('((center)|(top)|(bottom)|(left)|(right))')?\])|(\[[0-9]+(,\ ?[0-9]+)\])")]
        public string Position
        {
            get { return GetPropertyValue<string>("Position", null); }
            set { SetPropertyValue("Position", value); }
        }

        [JQueryElement("resizable")]
        public bool? Resizable
        {
            get { return GetPropertyValue<bool>("Resizable", null); }
            set { SetPropertyValue("Resizable", value); }
        }

        [JQueryElement("show")]
        public string ShowEffect
        {
            get { return GetPropertyValue<string>("ShowEffect", null); }
            set { SetPropertyValue("ShowEffect", value); }
        }

        [JQueryElement("stack")]
        public bool? Stack
        {
            get { return GetPropertyValue<bool>("Stack", null); }
            set { SetPropertyValue("Stack", value); }
        }

        [JQueryElement("title")]
        public string Title
        {
            get { return GetPropertyValue<string>("Title", null); }
            set { SetPropertyValue("Title", value); }
        }

        [JQueryElement("width")]
        public int? Width
        {
            get { return GetPropertyValue<int>("Width", null); }
            set { SetPropertyValue("Width", value); }
        }

        [JQueryElement("zIndex")]
        public int? ZIndex
        {
            get { return GetPropertyValue<int>("ZIndex", null); }
            set { SetPropertyValue("ZIndex", value); }
        }

        [JQueryEvent("beforeclose")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnClosing
        {
            get { return GetPropertyValue<string>("OnClosing", null); }
            set { SetPropertyValue("OnClosing", value); }
        }

        [JQueryEvent("open")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnOpen
        {
            get { return GetPropertyValue<string>("OnOpen", null); }
            set { SetPropertyValue("OnOpen", value); }
        }

        [JQueryEvent("focus")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnFocus
        {
            get { return GetPropertyValue<string>("OnFocus", null); }
            set { SetPropertyValue("OnFocus", value); }
        }

        [JQueryEvent("drag")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnDrag
        {
            get { return GetPropertyValue<string>("OnDrag", null); }
            set { SetPropertyValue("OnDrag", value); }
        }

        [JQueryEvent("dragStart")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnDragStart
        {
            get { return GetPropertyValue<string>("OnDragStart", null); }
            set { SetPropertyValue("OnDragStart", value); }
        }

        [JQueryEvent("dragStop")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnDragStop
        {
            get { return GetPropertyValue<string>("OnDragStop", null); }
            set { SetPropertyValue("OnDragStop", value); }
        }
        
        [JQueryEvent("resizeStart")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnResizeStart
        {
            get { return GetPropertyValue<string>("OnResizeStart", null); }
            set { SetPropertyValue("OnResizeStart", value); }
        }

        [JQueryEvent("resize")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnResize
        {
            get { return GetPropertyValue<string>("OnResize", null); }
            set { SetPropertyValue("OnResize", value); }
        }

        [JQueryEvent("resizeStop")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnResizeStop
        {
            get { return GetPropertyValue<string>("OnResizeStop", null); }
            set { SetPropertyValue("OnResizeStop", value); }
        }

        [JQueryEvent("close")]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [DefaultValue(null)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public string OnClose
        {
            get { return GetPropertyValue<string>("OnClose", null); }
            set { SetPropertyValue("OnClose", value); }
        }
        protected override string jQueryFunction
        {
            get { return "dialog"; }
        }
    }
}
